package view;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
//import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import net.miginfocom.swing.MigLayout;

/**
 * Main menu for the application
 * @author MUSAB
 *
 */
public class MainMenuView extends JMenuBar {
	public MainMenuView(){
		
		// File menu
		JMenu fileMenu = new JMenu("File");
		JMenuItem exitMenuItem = new JMenuItem("Exit");
		fileMenu.add(exitMenuItem);
		
		exitMenuItem.addActionListener
		( 
			new ActionListener()
			{
			    public void actionPerformed(ActionEvent event)
			    {
			    	System.exit( 0 );
			    }
			}
		);
		// Adding all menus to the instance
		this.add(fileMenu);
		
		JMenu helpMenu = new JMenu("Help");
		JMenuItem aboutMenuItem = new JMenuItem("About");
		helpMenu.add(aboutMenuItem);
			
		aboutMenuItem.addActionListener
		(
			new ActionListener()
			{
				public void actionPerformed( ActionEvent event )
				{
				    AboutCoolMail aboutBox = new AboutCoolMail();
				    
				    aboutBox.setVisible( true );
				}
			}
		);
		
		this.add(helpMenu);
	}
}
